/*
 * circular_buffer.c
 *
 *  Created on: Aug 4, 2012
 *      Author: Eugene Parkhomenko
 */

#include "msg_queue.h"

MSG_QUEUE_HEAD *MQ_init(void)
{
	struct MSG_QUEUE_HEAD *pstQueueHead = NULL;

	if (NULL == (pstQueueHead = malloc(sizeof(struct MSG_QUEUE_HEAD))))
	{
		SM_ERRNL(TRUE, "Memory allocation failed");
		goto exit;
	}

exit:
	return pstQueueHead;
}

void MQ_push(MSG_QUEUE_HEAD *pstQueueHead, ST_STH_EVENT_MESSAGE *pstMessage)
{
	LIST_INSERT_HEAD(pstQueueHead, pstMessage, stQueue);
}

ST_STH_EVENT_MESSAGE *MQ_pop(MSG_QUEUE_HEAD *pstQueue)
{
	// get element from end of the list
}
